#include"myRBTree.h"
#include<iostream>
#include<vector>
using namespace std;


void test1() {
	RBTree<int, int> b;
	b.Insert({ 1,1 });
	b.Insert({ 2,2 });
	b.Insert({ 5,5 });
	b.Insert({ 9,9 });
	b.Insert({ 3,3 });
	b.Insert({ 7,7 });
	b.InOrder();
	cout << b.IsBalance() << endl;
}
void TestRBTree2()
{
	const int N = 100000;
	vector<int> v;
	v.reserve(N);
	srand((unsigned int)time(0));

	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand() + i);
		//cout << v.back() << endl;
	}

	size_t begin2 = clock();
	RBTree<int, int> t;
	for (auto e : v)
	{
		t.Insert(make_pair(e, e));
	}
	size_t end2 = clock();
	cout << t.IsBalance() << endl;
}
int main() {
	TestRBTree2();
	//test1();
	return 0;
}